home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / tools / packer / unpacklib / programmers_docs / unpacklib_docs next >
Text File  |  1995-03-09  |  31KB  |  841 lines

  1. ***************************************************************************
  2. *                        UNPACK.LIBRARY V39.54 DOC                        *
  3. *                                                                         *
  4. *                                                                         *
  5. *                             Update 07-12-94                             *
  6. *                                                                         *
  7. *                                                                         *
  8. *                          SAFE HEX INTERNATIONAL                         *
  9. ***************************************************************************
  10.  
  11.  
  12. Welcome  to  the release version of this library. I hope it's a library you
  13. can  use  in your virus killer or whatever you are doing. One of the things
  14. this library can do, is to help a viruskiller programmer to scan files that
  15. are crunched.
  16.  
  17.  
  18.      o  This  library  is  copyrighted  by  SHI  and  may  NOT  be  used in
  19.         commercial programs without a written permission from SHI.
  20.  
  21.      o  SHI  members can of course use this library for free. (But remember
  22.         to get a written permission.
  23.  
  24.      o  All  Shareware programmers can be SHI members, if they full-fill to
  25.         support our anti-virus work. (But remember to send your address and
  26.         program idea to SHI, to get a written permission).
  27.  
  28.  
  29. It's  forbidden  to  reassemble  (reverse engining) in any way this library
  30. code.  All the ideas to the way we unpacks files are copyrighted by SHI. If
  31. you  don't  respect  our  copyright - or, if you use this library without a
  32. written permission, SHI will contact the police to stop you.
  33.  
  34. Please  add  the  "WantedHelp"  (a  list  containing  wanted  crunchers for
  35. update), and remember to credit the author (Thomas Neumann) and SHI in your
  36. program as stated in the following:
  37.  
  38. ---------------------------------------------------------------------------
  39.  
  40. ABOUT SAFE HEX INTERNATIONAL
  41. If you know a virus programmer you can get a reward of $ 1000 for supplying
  42. his  name  and  address.  The fact is that the law punishes data crime very
  43. severely. (5 years in jail in most countries).
  44.  
  45. We  are  an international group with more than 500 members who have started
  46. trying to stop the spread of virus. Let me give you some example:
  47.  
  48.         1. Our motto is: "Safe Hex", who dares do anything else today?".
  49.         2. A virus bank containing more than 1800 Amiga and PC viruses for
  50.            supporting good shareware antivirus programs.
  51.         3. We help people to get money back lost by virus infection.
  52.         4. We write articles about virus problems for about 20 computer
  53.            magazines worldwide.
  54.         5. We release the newest and the best virus killers around from
  55.            about 25 wellknown programmers worldwide.
  56.         6. We have more than 35 PC and Amiga "Virus Centers" worldwide
  57.            where you can get free virus help by phoning our "Hotline", and
  58.            the newest killers translated in your own language at very
  59.            little cost.
  60.  
  61. For more information contact:
  62.  
  63.         SAFE HEX INTERNATIONAL            (Please send 2 "Coupon-Response
  64.         Erik Loevendahl Soerensen         International" and a self addres-
  65.         Snaphanevej 10                    sed envelope, if you want infor-
  66.         DK-4720 Praestoe                  mation about SHI by letter).
  67.         Denmark
  68.         Phone: + 45 55 99 25 12
  69.         Fax  : + 45 55 99 34 98
  70.  
  71. ---------------------------------------------------------------------------
  72.  
  73. ***************************************************************************
  74. *                            Table of contents                            *
  75. ***************************************************************************
  76.  
  77. unpack.library/upAllocCInfo()
  78. unpack.library/upDetermineFile()
  79. unpack.library/upFreeCInfo()
  80. unpack.library/upFreeFile()
  81. unpack.library/upLoadFile()
  82. unpack.library/upNewUnpackNum()
  83. unpack.library/upSendCmd()
  84. unpack.library/upTestHunk()
  85. unpack.library/upUnpack()
  86. unpack.library/upUnpackList()
  87. unpack.library/upUnpackListNext()
  88. unpack.library/upUnuseDrive()
  89. unpack.library/upUseDrive()
  90.  
  91. ---------------------------------------------------------------------------
  92.  
  93. ***************************************************************************
  94. *                    Offsets and functions destiptions                    *
  95. ***************************************************************************
  96.  
  97.  
  98. upAllocCInfo(34.0)                                       upAllocCInfo(34.0)
  99.  
  100.  
  101. NAME
  102.         upAllocCInfo - allocates an info structure.
  103.  
  104. SYNOPSIS
  105.         info = upAllocCInfo ()
  106.          D0        -30
  107.  
  108.         APTR upAllocCInfo(VOID);
  109.  
  110. FUNCTION
  111.         upAllocCInfo() allocates an info structure the library uses when it
  112.         unpacks files. You just have to call this function in the beginning
  113.         of your program and then free it again with FreeCInfo() at the end.
  114.         I  have  made  this  function,  because  in future versions of this
  115.         library,  the  structure  will be bigger. Your program will then be
  116.         compatible for any future versions of this library.
  117.  
  118. INPUTS
  119.         None.
  120.  
  121. OUTPUTS
  122.         info  -  is a pointer to the allocated info structure. If there has
  123.                  occured an error, a zero is returned.
  124.  
  125. STRUCTURE
  126.         This is how the Info Structure is build:
  127.  
  128.         STRUCTURE UnpackInfo,0
  129.         APTR    UI_Filename
  130.         APTR    UI_Path
  131.         APTR    UI_Jump
  132.         APTR    UI_CruncherName
  133.         APTR    UI_DecrunchAdr
  134.         LONG    UI_DecrunchLen
  135.         UWORD   UI_ErrorNum
  136.         UWORD   UI_CrunchNum
  137.         UBYTE   UI_CrunchType
  138.         UBYTE   UI_Flag
  139.         APTR    UI_LoadNamePoi
  140.         LONG    UI_CrunchLen
  141.         APTR    UI_UserData             ;V35+
  142.         APTR    UI_TrackJump            ;V36+
  143.         APTR    UI_TrkErrJump           ;V36+
  144.         LONG    UI_Offset               ;V36+
  145.         UWORD   UI_Track                ;V36+
  146.         APTR    UI_ErrorMsg             ;V37+
  147.         APTR    UI_CrunchAdr            ;V37+
  148.         APTR    UI_LhaPattern           ;V38+
  149.         BOOL8   UI_UseFilenamePointer   ;V39+
  150.  
  151. ; This Is Private, Do NOT Touch
  152.  
  153.         UBYTE   UI_Pad
  154.         LONG    UI_CrunchLenTemp
  155.         LONG    UI_FileHandler
  156.         LONG    UI_Lock
  157.         LONG    UI_OldLock
  158.         APTR    UI_InfoAdr
  159.         APTR    UI_UnpackPoi
  160.         ULONG   UI_Temp
  161.         STRUCT  UI_Data,4*4             ;V35+
  162.         STRUCT  UI_LoadName,128
  163.         STRUCT  UI_ExecuteString,256
  164.         LABEL   UnpackInfo_SIZEOF
  165.  
  166.  
  167.         NOTE:
  168.         -----
  169.  
  170.         The private area is a bad idea to use, because the different fields
  171.         will maybe be moved around in future versions.
  172.  
  173.  
  174.         UI_Filename     is a pointer to the filename you want to scan.
  175.  
  176.         UI_Path         is  a  pointer  to a zero-terminated path where the
  177.                         library have to unpack archive files, such as a LHA
  178.                         archive. Please select a path where you haven't got
  179.                         some  important  data,  because  ALL  files will be
  180.                         deleted in the path if the DELETE flag is on.
  181.  
  182.         UI_Jump         This  is  a  pointer  to your scan routine. If this
  183.                         pointer are zero, no jump will be made.
  184.  
  185.         UI_CruncherName This is a pointer to the crunchers name the file is
  186.                         crunched with. The name are zero-terminated.
  187.  
  188.         UI_DecrunchAdr  This  is  the start address of the decrunched file.
  189.                         Your  scan routine just have to read this field and
  190.                         the UI_DecrunchLen field and scan that memory.
  191.  
  192.         UI_DecrunchLen  This is the length of the decrunched file.
  193.  
  194.         UI_ErrorNum     If  an  error  occur, the error number is stored in
  195.                         this   field.   See  the  unpack.i  file  for  more
  196.                         information.
  197.  
  198.         UI_CrunchNum    Here  is  the cruncher number stored. Each cruncher
  199.                         has  a  number  so  you can find out which cruncher
  200.                         there are used on the file.
  201.  
  202.         UI_CrunchType   Here   is  a  number  that  tells  about  the  file
  203.                         (archive, data or object file). Bit 7 indicate that
  204.                         the file are encrypted.
  205.  
  206.         UI_Flag         You  can  select  some different things the library
  207.                         has  to  do  when  it tests the file. See below for
  208.                         more info.
  209.  
  210.         UI_LoadNamePoi  This  is  just  a pointer to the UI_LoadName field.
  211.                         Use  this if you want to use the UI_LoadName field,
  212.                         because the field will be moved in future versions.
  213.  
  214.         UI_LoadName     Here  is  the filename stored, the library is about
  215.                         to decrunch, if the file is an archive.
  216.  
  217.         UI_CrunchLen    This is the length of the crunched file.
  218.  
  219.         UI_UserData     This  value  will be stored in A1 when the Unpack()
  220.                         function jump through the UI_Jump field. (V35+)
  221.  
  222.         UI_TrackJump    This field have the same function as UI_Jump, exept
  223.                         that  the library will only jump through this field
  224.                         when its unpack a track crunched file, such as DMS.
  225.                         The  library  will jump for every track it unpacks.
  226.                         You  have  to  return a return value in D0. You can
  227.                         select  between  these  values: 0 means every thing
  228.                         are   okay,   just   continue  and  -1  means  stop
  229.                         unpacking.  If this field are zero, no jump will be
  230.                         made (V36+).
  231.  
  232.         UI_TrkErrJump   The  library  will  jump through this pointer if an
  233.                         error  occurs.  There  are a lot of errors, such as
  234.                         checksum  error  etc.  You  routine  can  read  the
  235.                         UI_ErrorNum field in the info structure to see what
  236.                         went  wrong.  In  D0  you  have  to return the same
  237.                         values as in UI_TrackJump (V36+).
  238.  
  239.         UI_Offset       Here  will  be  stored the offset on a disk, ex. if
  240.                         the library just have unpacked track 40, there will
  241.                         be  stored  in this field: 40*22*512. You tracksave
  242.                         routine can read this field, UI_DecrunchAdr and the
  243.                         UI_DecrunchLen  fields  and just call the SendCmd()
  244.                         function with these values as parameters (V36+).
  245.  
  246.         UI_Track        Here  are  stored  the  track the library just have
  247.                         unpacked (V36+).
  248.  
  249.         UI_ErrorMsg     If  an error occurs, a pointer to the error message
  250.                         will be stored here (V37+).
  251.  
  252.         UI_CrunchAdr    This  is a pointer to the crunched data. If you use
  253.                         the  NoLoad  flag,  you  have  to  store  the start
  254.                         address and the length of the crunched data in this
  255.                         field and the UI_CrunchLen field (V37+).
  256.  
  257.         UI_LhaPattern   Here can you store a pointer to a Lha pattern. This
  258.                         means,  the  zero-terminated  string  this  pointer
  259.                         points to, will be copied at the end of the execute
  260.                         string. If you ex. have a string containing: "a#?",
  261.                         the  unpack.library  will  only  unpack  all  files
  262.                         starting with an "a". Zero in this pointer means no
  263.                         pattern (V38+).
  264.  
  265.                         NOTE:  This pointer will be ignored if you have set
  266.                         the UFB_OneFile bit in the UI_Flag.
  267.  
  268.         UI_UseFilenamePointer
  269.                         This  boolean  flag  will  be set to true, when you
  270.                         must    use    the   filename   pointed   to   with
  271.                         UI_LoadNamePoi.  If  false, you have to use you own
  272.                         filename.  This  flag  will  be  set  to  true when
  273.                         unpacking a file in an archive and the file type is
  274.                         not an archive. See example (V39+).
  275.  
  276.  
  277. The flag have the following functions:
  278.  
  279.  
  280. Name         Bit             Function
  281. ---------------------------------------------------------------------------
  282. UFB_OneFile  0          Select  to  unpack  one file at a time or the whole
  283.                         archive. If set, one file is selected.
  284.  
  285. UFB_Delete   1          Delete  files  after scanning. Set = Delete. If you
  286.                         set  this bit on, ALL files AND directories will be
  287.                         deleted,  not  only  the files there were stored in
  288.                         the archive.
  289.  
  290. UFB_NoFree   2          If this bit is set, the decrunched file will NOT be
  291.                         freed  from memory after the Unpack() function have
  292.                         called through the UI_Jump pointer. If you set this
  293.                         bit,  you  have to free the memory by yourself with
  294.                         the FreeFile() function. (V35+)
  295.  
  296. UFB_Banner   3          This  bit are the give banner bit. If set, you will
  297.                         get the banner text in UI_DecrunchAdr. Your routine
  298.                         the  UI_TrackJump  pointer  points to, have to test
  299.                         the  UI_Offset field to see it's a banner or normal
  300.                         track there are given. If the UI_Offset are -1, its
  301.                         a banner. (V36+)
  302.  
  303. UFB_NoLoad   4          If  this  bit  are  set,  the  DetermineFile()  and
  304.                         Unpack()  functions  will  not  load  the file into
  305.                         memory,  but  use the UI_CrunchAdr and UI_CrunchLen
  306.                         field  in  the  Unpack  Info  structure  to get the
  307.                         crunched data (V37+).
  308.  
  309. UFB_Protect  5          If you set this bit and the UFB_NoLoad are cleared,
  310.                         the   DetermineFile()   function  will  change  the
  311.                         protections  bit  on the file to determine. It will
  312.                         set the RWED bits (V38+).
  313.  
  314.              6-7        Reserved
  315.  
  316. BUGS
  317.         None known.
  318.  
  319. SEE ALSO
  320.         upFreeCInfo()
  321.  
  322. ---------------------------------------------------------------------------
  323.  
  324. upDetermineFile(34.0)                                 upDetermineFile(34.0)
  325.  
  326.  
  327. NAME
  328.         upDetermineFile - scans a file  to find out which cruncher that are
  329.                           used.
  330.  
  331. SYNOPSIS
  332.         success = upDetermineFile (info, filename)
  333.           D0           -42          A0      A1
  334.  
  335.         BOOL upDetermineFile (APTR, char *);
  336.  
  337. FUNCTION
  338.         upDetermineFile()  scans a file to find out which cruncher the file
  339.         are  crunched with. If the library can't find out, an error message
  340.         is  returned.  You  have  to  call  this  function  first, then the
  341.         upUnpack() function, if no error has occured.
  342.  
  343. INPUTS
  344.         info     - is  the  memory  address you got from the upAllocCInfo()
  345.                    function.
  346.  
  347.         filename - is  a  pointer  to  the  filename  you want to scan. The
  348.                    filename has to be zero-terminated.
  349.  
  350. OUTPUTS
  351.         success  - is an indicator that tells about the operation. If every
  352.                    thing is okay, a non-zero value is returned, else a zero
  353.                    will  be  returned. If you get an error, you can look at
  354.                    the  UI_ErrorNum  flag in the info structure to see what
  355.                    went wrong.
  356.  
  357. BUGS
  358.         None known.
  359.  
  360. SEE ALSO
  361.         upUnpack()
  362.  
  363. ---------------------------------------------------------------------------
  364.  
  365. upFreeCInfo(34.0)                                         upFreeCInfo(34.0)
  366.  
  367.  
  368. NAME
  369.         upFreeCInfo - frees the info structure again.
  370.  
  371. SYNOPSIS
  372.         upFreeCInfo (info)
  373.             -36       A0
  374.  
  375.         void upFreeCInfo (APTR);
  376.  
  377. FUNCTION
  378.         upFreeCInfo() frees the info structure again. You have to call this
  379.         function at the end of your program.
  380.  
  381. INPUTS
  382.         info  - is  the  memory  address  you  got  from the upAllocCInfo()
  383.                 function.  If the memory address is zero, you will NOT take
  384.                 a  trip  to  India  (and visit the GURU) when you call this
  385.                 function.
  386.  
  387. OUTPUTS
  388.         None.
  389.  
  390. BUGS
  391.         None known.
  392.  
  393. SEE ALSO
  394.         upAllocCInfo()
  395.  
  396. ---------------------------------------------------------------------------
  397.  
  398. upFreeFile(34.20)                                         upFreeFile(34.20)
  399.  
  400.  
  401. NAME
  402.         upFreeFile - frees a file from memory.
  403.  
  404. SYNOPSIS
  405.         upFreeFile (info)
  406.            -84       A0
  407.  
  408.         void upFreeFile (APTR);
  409.  
  410. FUNCTION
  411.         You   have  to  call  this  function  after  you  have  called  the
  412.         upLoadFile() function and are finished with the file. This function
  413.         frees the memory again.
  414.  
  415.         NOTE:  You MUST call this function instead of freeing the memory by
  416.         yourself!!
  417.  
  418. INPUTS
  419.         info - is   the  memory  address  you  got  from the upAllocCInfo()
  420.                function.  You  can  call  always this function, even if the
  421.                upLoadFile() function returned an error.
  422.  
  423. OUTPUTS
  424.         None.
  425.  
  426. BUGS
  427.         None known.
  428.  
  429. SEE ALSO
  430.         upLoadFile()
  431.  
  432. ---------------------------------------------------------------------------
  433.  
  434. upLoadFile(34.20)                                         upLoadFile(34.20)
  435.  
  436.  
  437. NAME
  438.         upLoadFile - loads a file into memory.
  439.  
  440. SYNOPSIS
  441.         success = upLoadFile (info)
  442.           D0         -78       A0
  443.  
  444.         BOOL upLoadFile (APTR);
  445.  
  446. FUNCTION
  447.         This  function allocate some memory with the files length and loads
  448.         the file into it. The filename are taken from the UI_Filename field
  449.         in  the  info  structure.  The  length  and address of the file are
  450.         stored in UI_DecrunchLen and UI_DecrunchAdr.
  451.  
  452.         V36.30:
  453.         -------
  454.         If  the library runs under KS 37+, all caches will be cleared after
  455.         the file are loaded into the memory.
  456.  
  457. INPUTS
  458.         info    - is  the  memory  address  you got from the upAllocCInfo()
  459.                   function.
  460.  
  461. OUTPUTS
  462.         success - is  an indicator that tells about the operation. If every
  463.                   thing  is  okay, the file length is returned, else a zero
  464.                   will  be returned and the allocated memory will be freed.
  465.                   If you get an error, you can look at the UI_ErrorNum flag
  466.                   in the info structure to see what went wrong.
  467.  
  468. BUGS
  469.         None known.
  470.  
  471. SEE ALSO
  472.         upFreeFile()
  473.  
  474. ---------------------------------------------------------------------------
  475.  
  476. upNewUnpackNum(37.32)                                 upNewUnpackNum(37.32)
  477.  
  478.  
  479. NAME
  480.         upNewUnpackNum - gives the number of unpackers in a structure.
  481.  
  482. SYNOPSIS
  483.         number = upNewUnpackNum ()
  484.           A0         -108
  485.  
  486.         APTR upNewUnpackNum (void);
  487.  
  488. FUNCTION
  489.         upNewUnpackNum()  counts  the  number  of unpackers the library can
  490.         determine  and  unpack.  You  will  get  two  different  numbers of
  491.         unpackers. The first one (types) are the numbers of different types
  492.         the  library  can  unpack,  example  PowerPacker  Data, PowerPacker
  493.         Library etc. The second one (unpackers) is the number of unpackers,
  494.         example PowerPacker, Lha, Imploder etc.
  495.  
  496. INPUTS
  497.         None.
  498.  
  499. OUTPUTS
  500.         number - a pointer to a structure that look like this:
  501.  
  502.                 STRUCTURE NumberStruct,0
  503.                 UWORD   NS_Version      ;Library Version
  504.                 UWORD   NS_Revision     ;Library Revision
  505.                 UWORD   NS_Types
  506.                 UWORD   NS_Unpackers
  507.                 LABEL   NumberStruct_SIZEOF
  508.  
  509. BUGS
  510.         None known.
  511.  
  512. ---------------------------------------------------------------------------
  513.  
  514. upSendCmd(36.30)                                           upSendCmd(36.30)
  515.  
  516.  
  517. NAME
  518.         upSendCmd - sends a command to a devive.
  519.  
  520. SYNOPSIS
  521.         error = upSendCmd (dinfo, address, offset, length, cmd)
  522.          D0       -102      A0      A1       D1      D2    D0
  523.  
  524.         UBYTE upSendCmd (APTR, APTR, ULONG, ULONG, UBYTE);
  525.  
  526. FUNCTION
  527.         The  only  thing  this  function does, is send the command with the
  528.         parameters  to  the device opened by the upUseDrive() function. The
  529.         command will be sent by the DoIO() function.
  530.  
  531. INPUTS
  532.         dinfo   - is a pointer returned by the upUseDrive() function.
  533.  
  534.         address - is a pointer to the data area.
  535.  
  536.         offset  - is the offset on the disk.
  537.  
  538.         length  - is the number of bytes to send.
  539.  
  540.         cmd     - is the command to send, like a read, write or update.
  541.  
  542. OUTPUTS
  543.         error   - is the error number returned by the device.
  544.  
  545. BUGS
  546.         None known.
  547.  
  548. SEE ALSO
  549.         upUseDrive(), upUnuseDrive()
  550.  
  551. ---------------------------------------------------------------------------
  552.  
  553. upTestHunk(34.1)                                           upTestHunk(34.1)
  554.  
  555.  
  556. NAME
  557.         upTestHunk - tests the hunk structure in a file.
  558.  
  559. SYNOPSIS
  560.         success = upTestHunk (address)
  561.           D0         -54        A0
  562.  
  563.         BOOL upTestHunk (APTR);
  564.  
  565. FUNCTION
  566.         upTestHunk()  tests  a  file for the hunk structure. You have to be
  567.         sure,  that  the file you want to test is an object file, else this
  568.         routine  will  return  an  error. You can check this by look in the
  569.         UI_CrunchType  flag  in  the info structure. You don't need to call
  570.         this  function  by  yourself  before  you  calling  the  upUnpack()
  571.         function,  because the upUnpack() function does that by itself. I'm
  572.         not quite sure it handles the overlay hunk correctly, but it should
  573.         handle  it.  If you find a file you know are okay and this function
  574.         says it's defect, please send me the file so I can find the error.
  575.  
  576. INPUTS
  577.         address - is the start address of the file you want to test.
  578.  
  579. OUTPUTS
  580.         success - is  an indicator that tells about the operation. If every
  581.                   thing  is okay, a non-zero value is returned, else a zero
  582.                   will be returned.
  583.  
  584. BUGS
  585.         None known.
  586.  
  587. ---------------------------------------------------------------------------
  588.  
  589. upUnpack(34.0)                                               upUnpack(34.0)
  590.  
  591.  
  592. NAME
  593.         upUnpack - unpacks the file.
  594.  
  595. SYNOPSIS
  596.         success = upUnpack (info)
  597.           D0        -48      A0
  598.  
  599.         BOOL upUnpack (APTR);
  600.  
  601. FUNCTION
  602.         upUnpack() loads the file into memory and unpacks it. When the file
  603.         is  unpacked,  the library will jump through the UI_Jump pointer to
  604.         your scan routine. If the UI_Jump contains a zero, the library will
  605.         not  jump.  All  what  your  scan  routine has to do, is to get the
  606.         UI_DecrunchAdr  and UI_DecrunchLen from the info structure and scan
  607.         that memory. If the file is an archive (Lha, zoo), the library will
  608.         unpack  the  archive  and  then read one file at a time and jump to
  609.         your scan routine.
  610.         If  you  need  a password to unpack a file, the library will open a
  611.         little  window  where  it asks for the password. The window will be
  612.         opened  on  the active screen, so if you open a screen by yourself,
  613.         the window will appear on it (if it's active).
  614.  
  615.         NOTE:
  616.         -----
  617.         After  an  archive  is  unpacked  and  scanned,  all  the files and
  618.         directories  in  the  path you have selected will be deleted if the
  619.         DELETE  flag  is  on,  not  just the files there were stored in the
  620.         archive,  but  ALL  files will be deleted, so be sure to use a temp
  621.         directory or something like that.
  622.  
  623.         V35.22:
  624.         -------
  625.         When this function jumps through the UI_Jump pointer, the following
  626.         registers will have these pointers:
  627.  
  628.         A0 = The start address of your routine (Unpack() makes a jsr (a0)).
  629.         A1 = Your pointer stored in the UI_UserData field.
  630.         A4 = The start address of the info structure.
  631.  
  632.         V36.30:
  633.         -------
  634.         If the library runs under KS V37+, all caches will be cleared after
  635.         the decrunching.
  636.  
  637.         Track Crunched Files:
  638.         ---------------------
  639.         This  function  will  jump  through UI_TrackJump instead of UI_Jump
  640.         when  it  unpacks  a  track crunched file. Such files are ex. a DMS
  641.         file.  The  routine have to return a value in D0. The values can be
  642.         0 to indicate that every things are ok and -1 to stop unpacking.
  643.  
  644.         V38.40:
  645.         -------
  646.         This  function  are  now  made  recursive.  That means it will call
  647.         itself  until  the  file  can't  be decrunched any more. Now it can
  648.         unpack  a  lha  file in a lha file or a file crunched with imploder
  649.         and  powerpacker  etc.  If you have ex. select to unpack a lha file
  650.         at  RAM:,  the  first lha file will be unpacked there. If there are
  651.         more  lha  files,  the next one will be unpacked in RAM:-xxx/ where
  652.         xxx is the name of the lha archive etc.
  653.  
  654.         NOTE:
  655.         -----
  656.         The  recursive  process  will  take a lot of stack and memory. Each
  657.         time  the  function  will  call itself, it will allocate a new info
  658.         structure and 256 bytes to the new path.
  659.  
  660. INPUTS
  661.         info     - is  the  memory  address you got from the upAllocCInfo()
  662.                    function.
  663.  
  664. OUTPUTS
  665.         success  - is an indicator that tells about the operation. If every
  666.                    thing is okay, a non-zero value is returned, else a zero
  667.                    will  be  returned. If you get an error, you can look at
  668.                    the  UI_ErrorNum  flag in the info structure to see what
  669.                    went wrong.
  670.  
  671. BUGS
  672.         The  DMS Deep decruncher will not work correctly. I try to fix this
  673.         bug as soon as possible.
  674.  
  675. SEE ALSO
  676.         upDetermineFile(), upAllocCInfo()
  677.  
  678. ---------------------------------------------------------------------------
  679.  
  680. upUnpackList(34.1)                                       upUnpackList(34.1)
  681.  
  682.  
  683. NAME
  684.         upUnpackList - makes an unpacker name list.
  685.  
  686. SYNOPSIS
  687.         name = upUnpackList (info)
  688.          A1        -66        A0
  689.  
  690.         char * upUnpackList (APTR);
  691.  
  692. FUNCTION
  693.         upUnpackList()  gives  a  pointer to the first name to a packer the
  694.         library  can  determine & unpack. You can use this function, if you
  695.         want  to  make  a  list  over  all  the  unpackers  the library can
  696.         determine.    Call    this    function    first    and   then   use
  697.         upUnpackListNext().
  698.  
  699. INPUTS
  700.         info - is   the  memory  address  you  got  from the upAllocCInfo()
  701.                function.
  702.  
  703. OUTPUTS
  704.         name - is  a  pointer  to  a null-terminated string where the first
  705.                name are stored.
  706.  
  707. BUGS
  708.         None known.
  709.  
  710. SEE ALSO
  711.         upUnpackListNext()
  712.  
  713. ---------------------------------------------------------------------------
  714.  
  715. upUnpackListNext(34.1)                               upUnpackListNext(34.1)
  716.  
  717.  
  718. NAME
  719.         upUnpackListNext - reads the next name in the unpacker list.
  720.  
  721. SYNOPSIS
  722.         success,name = upUnpackListNext (info)
  723.           D0     A1          -72          A0
  724.  
  725.         BOOL,APTR upUnpackListNext (APTR);
  726.  
  727. FUNCTION
  728.         upUnpackListNext() gives a pointer to the next name to a packer the
  729.         library  can  determine & unpack. You can use this function, if you
  730.         want  to  make  a  list  over  all  the  unpackers  the library can
  731.         determine. Call the upUnpackList() function first and then use this
  732.         function.
  733.  
  734. INPUTS
  735.         info    - is  the  memory  address  you got from the upAllocCInfo()
  736.                   function.
  737.  
  738. OUTPUTS
  739.         name    - is  a  pointer to a null-terminated string where the next
  740.                   name are stored.
  741.  
  742.                   V37.32
  743.                   ------
  744.                   This  pointer will also be zero when the success flag are
  745.                   zero. This are only made for C-programmers.
  746.  
  747.         success - if  this  contains a zero, there are no more crunchers in
  748.                   the list. Otherwise it will contain a non-zero value.
  749.  
  750. BUGS
  751.         None known.
  752.  
  753. SEE ALSO
  754.         upUnpackList()
  755.  
  756. ---------------------------------------------------------------------------
  757.  
  758. upUnuseDrive(36.30)                                     upUnuseDrive(36.30)
  759.  
  760.  
  761. NAME
  762.         upUnuseDrive - give back the drive to DOS.
  763.  
  764. SYNOPSIS
  765.         upUnuseDrive (dinfo)
  766.             -96        A0
  767.  
  768.         void upUnuseDrive (APTR);
  769.  
  770. FUNCTION
  771.         This function closes the device again and make the drive unbusy.
  772.  
  773. INPUTS
  774.         dinfo - is the pointer returned by the upUseDrive() function.
  775.  
  776. OUTPUTS
  777.         Nothing.
  778.  
  779. BUGS
  780.         None known.
  781.  
  782. SEE ALSO
  783.         upUseDrive(), upSendCmd()
  784.  
  785. ---------------------------------------------------------------------------
  786.  
  787. upUseDrive(36.30)                                         upUseDrive(36.30)
  788.  
  789.  
  790. NAME
  791.         upUseDrive - make a drive busy and ready for use.
  792.  
  793. SYNOPSIS
  794.         dinfo = upUseDrive (info, drive)
  795.          D0        -90       A0     A1
  796.  
  797.         APTR upUseDrive (APTR, char *);
  798.  
  799. FUNCTION
  800.         This  function  find out which device the drive given uses and open
  801.         it. Then it will make the drive busy, that means CLI/WorkBench will
  802.         not  be  able  to  use that drive until you unuse it. It's only you
  803.         that  can use it. This function are only made to give you a help to
  804.         write a track crunched-file saver.
  805.  
  806. INPUTS
  807.         info  - is  the  memory  address  you  got  from the upAllocCInfo()
  808.                 function.
  809.  
  810.         drive - is a pointer to the drive you want to use, ex. DF0:, RAD:.
  811.  
  812. OUTPUTS
  813.         dinfo - is  a  pointer  to  a  structure  used  by the device. This
  814.                 structure  includes a IOStdReq structure and a message port
  815.                 structure.  If  you  get  a zero back, an error occurs. You
  816.                 can see in the UI_ErrorNum field to see want went wrong.
  817.  
  818. BUGS
  819.         None known.
  820.  
  821. SEE ALSO
  822.         upUnuseDrive(), upSendCmd()
  823.  
  824. ---------------------------------------------------------------------------
  825.  
  826.         I  really  hope  you  can use this library. See also the Unpack.IFF
  827.         file to see how to construct your program.
  828.  
  829.         If  you  find any bugs in the library or if you have some crunchers
  830.         there  are  not  in  the  library,  please send a bug report or the
  831.         crunchers to me, thanks! See in the "WantedHelp" for more info!
  832.  
  833.  
  834.    WE NEED YOUR HELP TO GET THIS LIBRARY EVEN BETTER, THANK YOU VERY MUCH!
  835.  
  836.  
  837.         Thomas Neumann       Member of the SHI Anti Virus Group.
  838.         Kongensgade 78
  839.         3550 Slangerup
  840.         Denmark
  841.